package cn.zwx.distributed.svc.mapper;

import cn.zwx.distributed.svc.domain.entity.WorkerNodeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
* @author zhangwenxue
* @description 针对表【worker_node(DB WorkerID Assigner for UID Generator)】的数据库操作Mapper
* @createDate 2023-07-21 21:04:48
* @Entity generator.domain.WorkerNode
*/
public interface WorkerNodeMapper extends BaseMapper<WorkerNodeEntity> {

    /**
     * 新增
     * @param record 新增请求参数
     * @return 返回影响行数
     */
    int insertSelective(WorkerNodeEntity record);

    /**
     * 修改
     * @param record 修改请求参数
     * @return 返回影响行数
     */
    int updateByPrimaryKeySelective(WorkerNodeEntity record);


    /**
     * Get {@link WorkerNodeEntity} by node host
     *
     * @param host host
     * @param port port
     * @return WorkerNodeEntity
     */
    WorkerNodeEntity getWorkerNodeByHostPort(@Param("host") String host, @Param("port") String port);

}
